import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import DefineOptions from 'unplugin-vue-define-options/vite'
import { resolve } from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [DefineOptions(), vue()],
  resolve: {
    alias: [
      {
        find: '@',
        replacement: resolve('src')
      },
    ]
    
  },
  server: {
    host: '0.0.0.0',
    port: 3000,
    proxy: {
      "/api": {
        target: "http://localhost:7031",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  },
  // 打包
  build: {
    // 打包输出目录
    outDir: 'hello',
    minify: true //是否进行压缩
  }
})
